package o;

import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.framework.widget.uxwidget.hwdotspageindicator.HwTopBannerIndicator;
import java.util.ArrayList;
import java.util.List;

public class dks {
    private static dks ॱ;
    private List<HwTopBannerIndicator> ˋ = new ArrayList();

    public static synchronized dks ˊ() {
        dks o_dks;
        synchronized (dks.class) {
            if (ॱ == null) {
                ॱ = new dks();
            }
            o_dks = ॱ;
        }
        return o_dks;
    }

    public void ॱ(int i) {
        for (HwTopBannerIndicator hwTopBannerIndicator : this.ˋ) {
            if (hwTopBannerIndicator != null) {
                if (i == 1) {
                    hwTopBannerIndicator.ˋ();
                } else if (i == 0) {
                    hwTopBannerIndicator.ॱ();
                } else {
                    boolean ॱᐧ;
                    Object tag = hwTopBannerIndicator.getTag();
                    if (tag instanceof CardBean) {
                        ॱᐧ = ((CardBean) tag).ॱᐧ();
                        hwTopBannerIndicator.setmFragmentSelected(ॱᐧ);
                    } else {
                        ॱᐧ = false;
                    }
                    if (ॱᐧ) {
                        hwTopBannerIndicator.ˋ();
                    } else {
                        hwTopBannerIndicator.ॱ();
                    }
                }
            }
        }
    }

    public void ˊ(HwTopBannerIndicator hwTopBannerIndicator) {
        this.ˋ.add(hwTopBannerIndicator);
    }

    public void ˎ(HwTopBannerIndicator hwTopBannerIndicator) {
        this.ˋ.remove(hwTopBannerIndicator);
    }
}
